package com.ccp.dev.im.server.constant;

import io.netty.util.AttributeKey;

public class Constants {

    public static interface ImserverConfig{
    	//连接空闲时间
      	public static final int READ_IDLE_TIME = 60;//秒
      	//发送心跳包循环时间
      	public static final int WRITE_IDLE_TIME = 40;//秒
        //心跳响应 超时时间
      	public static final int PING_TIME_OUT = 70; //秒   需大于空闲时间
      	
        // 最大协议包长度
        public static final int MAX_FRAME_LENGTH = 1024 * 10; // 10k
        //
        public static final int MAX_AGGREGATED_CONTENT_LENGTH = 65536;
        
        public static final String REBOT_SESSIONID="0";//机器人SessionID
        
        public static final int WEBSOCKET = 1;//websocket标识
        
        public static final int SOCKET =0;//socket标识

    }

	/**
	 * 群聊添加人员，群聊删除人员，如果群已经解散返回的错误码
	 */
	public static final int CUSTOME_ROOM_ERROR = 2;

    public static interface SessionConfig{
    	 public static final String SESSION_KEY= "userId" ;
    	 public static final AttributeKey<String> SERVER_SESSION_ID = AttributeKey.valueOf(SESSION_KEY);
    	 public static final AttributeKey SERVER_SESSION_HEARBEAT = AttributeKey.valueOf("heartbeat");
    }
    
    public static interface ProtobufType{
    	 byte SEND = 1; //请求
    	 byte RECEIVE = 2; //接收
    	 byte NOTIFY = 3; //通知
    	 byte REPLY = 4; //回复
	}
   
    public static interface CmdType{
	   	 byte BIND = 1; //绑定  
	   	 byte HEARTBEAT = 2; //心跳 
	   	 byte ONLINE = 3; //上线
	   	 byte OFFLINE = 4; //下线 先用这个状态位当隐身状态位使用。
	   	 byte MESSAGE = 5; //消息
	   	 byte RECON = 6; //重连
	   	 byte GROUP_DISSOLUTION_PUSH_MESSAGE = 7; //解散群后，后台推送消息给前台
	}

    public static interface UserType{
	   	 String ONLINE = "online"; //在线
	   	 String OFFLINE = "offline"; //离线
	   	 String HIDE = "hide"; //隐身
	}

    public static interface MsgStatus{
		Integer IS_READ_Y = 1; //是否已读  已读
		Integer IS_READ_N = 0; //是否已读  未读
		Integer IS_Del_Y = 1;  //是否删除  是
		Integer IS_Del_N = 0;  //是否删除  否
		Integer IS_BACK_Y = 1; //是否撤销  是
		Integer IS_BACK_N = 0; //是否撤销  否
	}

    public static interface MsgType{
		Integer TEXT = 0; 		//文本
		Integer PICTURE = 1; 	//图片
		Integer FILE = 2;  		//文件
		Integer AUDIO  = 3;  	//音频
		Integer VIDEO = 4; 	//视频
	}

	public static interface SystemMsgType{
		Integer ADD_ROOM_USER = 0; 	//添加群成员
		Integer DEL_ROOM_USER = 1; 	//删除群成员
		Integer ADD_FRIEND = 2;  	//添加好友
		Integer DEL_FRIEND  = 3;  	//删除好友
		Integer UPDATE_ROOM_INFO = 4; 	//修改群信息
		Integer DEL_ROOM = 5; 	//解散群
		Integer UPDATE_USER_INFO = 6; 	//修改用户信息
		Integer LOGIN_TIME_OUT = 99; 	//登陆超时
	}

    public static interface UploadType{
		String PICTURE = "0"; 		//图片
		String FILE = "1"; 		//文件
	}

}
